package com.example.providerdemo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author kw
 * @program cloud-alibaba-demo
 * @description nacos 回调api
 * @create 2024 - 06 - 28 09:22
 **/
@RestController
@RequestMapping("echo")
@RefreshScope
public class EchoController {


    @GetMapping("/{param}")
    public String echo(@PathVariable String param) {
        return "hello " + param ;
    }

    // 踩坑 -- nacos 配置中格式一个空格
    @Value("${pattern.datetime}")
    private String dateformat;

    @GetMapping("dateformat")
    public String now(){
        return dateformat;
    }


}
